package com.ycz.cglib;

import org.springframework.cglib.proxy.Enhancer;

/**
 * @author ycz
 * @date 2021/7/3
 * 测试cglib
 */
public class TestCglib1 {

    /**
     * 生成动态代理类
     * @param args
     */
    public static void main(String[] args) {
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(ObjProxyClass1.class);
        enhancer.setCallback(new ObjProxyClassInterceptor());
        ObjProxyClass1 objProxyClass1 = (ObjProxyClass1) enhancer.create();
        objProxyClass1.print1();
        objProxyClass1.print1();
        objProxyClass1.print2();
    }


}
